package cn.itcast.order.config;

import cn.itcast.order.client.fallback.UserClientFallbackFactory;
import feign.Logger;
import org.springframework.context.annotation.Bean;

/**
 * @Author xph
 * @Date 2022/8/9 12:05
 * @Description: feign自定义配置
 */

public class DefaultFeignConfiguration {

    /**
     * 日志级别
     * @return
     */
    @Bean
    public Logger.Level feignLogLevel(){
        return Logger.Level.BASIC;
    }

    /**
     * 调用user-client失败降级的处理
     * @return
     */
    @Bean
    public UserClientFallbackFactory userClientFallbackFactory(){
        return new UserClientFallbackFactory();
    }
}
